<template>
  <div class="goback">
    <div @click="goback">
      <img src="../assets/other/goback.png" alt="">
      <span>
        {{name}}
      </span>
    </div>
    <section>
    </section>
  </div>
</template>
<script>
export default {
  name:'goback',
  data () {
    return {
      name: this.getName,
      URL: this.getURL
    }
  },
  props: {
    getName: String,
    getURL: String
  },
  methods: {
    goback () {
      let vm = this
      if (vm.URL) {
        vm.$router.push({path:vm.URL})
      } else {
        vm.$router.back(-1)
      }
    }
  }
}
</script>
<style scoped>
 .goback{
   padding: .5rem;
   display: flex;
   flex-direction: row;
   justify-content: space-between;
   text-align: center;
   align-items: center;
   background-color: white;
 }
 .goback img{
   padding-right: .5rem;
   height: 1rem;
 }
 .goback div{   
   display: flex;
   flex-direction: row;
   justify-content: space-between;
   text-align: center;
   align-items: center;
 }
 .goback section{
  font-size:0.8rem;
  color:rgba(102,102,102,1);
 }
</style>
